﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" Inherits="Pay_Term_List" CodeFile="Pay_Term_List.aspx.cs" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <title>付款条款维护 </title>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server">
    </asp:ScriptManagerProxy>
    <table id="wsd_inputtable">
        <tr>
            <td class="tabletitle">
                付款条款列表
            </td>
        </tr>
    </table>
    <table id="wsd_listtable" width="100%">
        <tr>
            <td style="width: 100%">
                <asp:UpdatePanel ID="updatePanel2" runat="server">
                    <ContentTemplate>
                        <asp:GridView Width="100%" ID="gvChannelType" runat="server" DataKeyNames="ID" AutoGenerateColumns="False"
                            EmptyDataText="没有可显示的数据." EmptyDataRowStyle-Font-Bold="true" EmptyDataRowStyle-HorizontalAlign="Center"
                            OnRowDataBound="Grid_RowDataBound" EnableEmptyContentRender="true" 
                            OnSelectedIndexChanged="gvChannelType_SelectedIndexChanged" 
                            AllowPaging="True" onpageindexchanging="gvChannelType_PageIndexChanging" 
                            PageSize="20">
                            <HeaderStyle CssClass="titlist" />
                            <EmptyDataRowStyle Font-Bold="True" HorizontalAlign="Center" />
                            <Columns>
                                <asp:ButtonField CommandName="Select" ButtonType="Link" ControlStyle-Font-Underline="false"
                                    DataTextField="SAPCODE" HeaderText="代码">
                                    <ControlStyle Font-Underline="False" />
                                </asp:ButtonField>
                                <asp:ButtonField CommandName="Select" ButtonType="Link" ControlStyle-Font-Underline="false"
                                    DataTextField="DESCRIPTION" HeaderText="描述">
                                    <ControlStyle Font-Underline="False" />
                                </asp:ButtonField>
                                <asp:BoundField DataField="TypeName" HeaderText="支付类型" />
                                <asp:BoundField HeaderText="百分比" DataField="PERCENT" />
                                <asp:BoundField HeaderText="到期天数" DataField="DUEDAYS" />
                                <asp:TemplateField HeaderText="有效" ItemStyle-HorizontalAlign="center" HeaderStyle-HorizontalAlign="center">
                                <ItemTemplate>
                                    <b><%# (bool)Eval("IsValid") ? "<font size='3' color='green'>√</font>" : "<font size='3' color='red'>×</font>"%></b>
                                </ItemTemplate>
                                    <HeaderStyle HorizontalAlign="Center" />
                                    <ItemStyle HorizontalAlign="Center" />
                            </asp:TemplateField>
                              
                            </Columns>
                            <RowStyle CssClass="evenline" />
                            <AlternatingRowStyle CssClass="oddline" />
                            <PagerSettings FirstPageText="首页" LastPageText="尾页" Mode="NumericFirstLast" 
                                PageButtonCount="30" />
                        </asp:GridView>
                    </ContentTemplate>
                    <Triggers>
                    </Triggers>
                </asp:UpdatePanel>
            </td>
        </tr>
    </table>
    <table id="wsd_inputtable">
        <tr>
            <td height="10px" width="100%" class="tabletitle">
                操作选项
            </td>
        </tr>
        <tr>
            <td class="buttonarea">
                <asp:Button ID="btnNew" runat="server" class="wsd_button2" Text="新  增" OnClick="btnNew_Click" />&nbsp;&nbsp;
            </td>
        </tr>
    </table>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <div id="editArea" runat="server" visible="false" class="editArea">
                <table id="wsd_inputtable" style="width:100%">
                    <tr>
                        <td class="tabletitle" style="width:100%">
                            编辑
                        </td>
                        <td class="tabletitle">
                            <asp:ImageButton ID="ImageButton1" BorderStyle="Solid" runat="server" CausesValidation="false" Height="18"
                                Width="18" ImageUrl="~/Resources/Images/0.png" OnClick="btnCancel_Click" />
                        </td>
                    </tr>
                    <tr>
                        <td colspan=2>
                            <center>
                                <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" DataSourceID="ObjectDataSource1"
                                    DefaultMode="Insert" BorderStyle="None" GridLines="None" OnDataBound="DetailsView1_DataBound">
                                    <Fields>
                                        <asp:TemplateField>
                                            <ItemTemplate>
                                                <table>
                                                    <tr>
                                                        <td colspan="2">
                                                          
                                                            <font color="red" size="4"><b>提示:*为必填项</b></font>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="tablefield" style="width: 40%">
                                                            <span class="keyword">*</span>代码:
                                                        </td>
                                                        <td>
                                                            <asp:TextBox runat="server"  ID="txtCode" MaxLength="20" Text='<%# Bind("SAPCode") %>'></asp:TextBox>
                                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="代码不能为空"
                                                                ControlToValidate="txtCode"></asp:RequiredFieldValidator>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="tablefield">
                                                            <span class="keyword">*</span>描述:
                                                        </td>
                                                        <td nowrap="nowrap">
                                                            <asp:TextBox runat="server"  ID="txtDescription" Text='<%# Bind("Description") %>'
                                                                MaxLength="20"></asp:TextBox>
                                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="描述不能为空"
                                                                ControlToValidate="txtDescription"></asp:RequiredFieldValidator>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="tablefield">
                                                            <span class="keyword">*</span>支付类型:
                                                        </td>
                                                        <td>
                                                            <asp:DropDownList runat="server" ID="ddlPayType" Width="130" AppendDataBoundItems="True">
                                                            </asp:DropDownList>
                                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ErrorMessage="支付类型不能为空"
                                                                ControlToValidate="ddlPayType"></asp:RequiredFieldValidator>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="tablefield">
                                                            <span class="keyword">*</span>百分比:
                                                        </td>
                                                        <td nowrap="nowrap">
                                                            <asp:TextBox runat="server" MaxLength="3" ID="txtPercent" Text='<%# Bind("Percent") %>'></asp:TextBox>
                                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ErrorMessage="百分比不能为空" Display="Dynamic"
                                                                ControlToValidate="txtPercent"></asp:RequiredFieldValidator>
                                                            <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ErrorMessage="百分比应为数字"
                                                                ValidationExpression="^(\d{1,3}(,\d\d\d)*(\.\d+)?|\d+(\.\d+)?)$" ControlToValidate="txtPercent"></asp:RegularExpressionValidator>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="tablefield">
                                                            <span class="keyword">*</span>付款期限:
                                                        </td>
                                                        <td nowrap="nowrap">
                                                            <asp:TextBox runat="server" ID="txtDueDays" Text='<%# Bind("DueDays") %>' MaxLength="3"></asp:TextBox>&nbsp;天
                                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ErrorMessage="到期天数不能为空" Display="Dynamic"
                                                                ControlToValidate="txtDueDays"></asp:RequiredFieldValidator>
                                                            <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ErrorMessage="到期天数应为数字"
                                                                ValidationExpression="^(\d{1,3}(,\d\d\d)*(\.\d+)?|\d+(\.\d+)?)$" ControlToValidate="txtDueDays"></asp:RegularExpressionValidator>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="tablefield">
                                                            有效:
                                                        </td>
                                                        <td nowrap="nowrap">
                                                            <asp:CheckBox runat="server" ID="ckbIsValid" Checked='<%# Bind("IsValid") %>' />
                                                        </td>
                                                    </tr>
                                                </table>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                    </Fields>
                                </asp:DetailsView>
                                <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" DataObjectTypeName="Jumpton.SFA.Server.Entity.PAY_TERMS"
                                    InsertMethod="Save" SelectMethod="Load" TypeName="Jumpton.SFA.Server.BusinessRule.MasterData.PayItemManager"
                                    UpdateMethod="Save">
                                    <SelectParameters>
                                        <asp:ControlParameter ControlID="gvChannelType" Name="id" PropertyName="SelectedValue"
                                            Type="Decimal" />
                                    </SelectParameters>
                                </asp:ObjectDataSource>
                            </center>
                        </td>
                    </tr>
                </table>
                <table id="wsd_inputtable" style="width:100%">
                    <tr>
                        <td height="10px" width="100%" class="tabletitle">
                            操作选项
                        </td>
                    </tr>
                    <tr>
                        <td class="buttonarea">
                            <asp:Button ID="btnSave" runat="server" class="wsd_button2" Text="保  存" OnClick="btnSave_Click" />&nbsp;&nbsp;
                            <asp:Button ID="btnCancel" runat="server" class="wsd_button2" Text="取  消" CausesValidation="false"
                                OnClick="btnCancel_Click" />
                        </td>
                    </tr>
                </table>
            </div>
            <div id="back" runat="server">
            </div>
        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="DetailsView1" EventName="DataBound" />
            <asp:AsyncPostBackTrigger ControlID="btnSave" EventName="Click" />
            <asp:AsyncPostBackTrigger ControlID="btnCancel" EventName="Click" />
            <asp:AsyncPostBackTrigger ControlID="ImageButton1" EventName="Click" />
        </Triggers>
    </asp:UpdatePanel>
</asp:Content>
